jQuery(function () {
	//Hides the Slide Images and Panel Texts for Preloading
	jQuery('.slideimage').hide();
	var slidenos = jQuery('.slideimage').length;
});

var i;

jQuery(window).bind("load", function() {

	//Preload

	var slidenos = jQuery('.slideimage').length;

		jQuery('.slideimage:hidden').fadeIn(800);
		jQuery(".kwicks.horizontal li").css('background', '#000');
		jQuery('.kwicks').kwicks({
			max : 450,
			spacing : 0
		});
		


});

jQuery(function(){

	//Hide all Captions and Mini Captions
	jQuery(".slidecaption").fadeTo(1, 0);
	jQuery(".slide-minicaption").fadeTo(1, 0.8);


	//On hover of a Kwick Panel
	//The Following Block is repeated for every Kwick Panel added
	//Basically It Hide the mini captions - Shows the hovered Panel with Full Caption and Fades the rest.
	//On Mouse Out it resets things back with mini captions
	//If you Add another Panel Simply Duplicate this block with additional kwickblock#
	jQuery('#kwickblock1').hover(function() {
		jQuery(".slide-minicaption").stop().fadeTo("fast", 0);	// Hide Mini Caption
		jQuery('#kwickblock1 .slidecaption').stop().fadeTo("slow", 0.8);	// Show Fullcaption
		jQuery("#kwickblock1 .slideimage").stop().fadeTo("slow", 1);	// Show Image in without transparency
		jQuery("#kwickblock2 .slideimage,#kwickblock3 .slideimage,#kwickblock4 .slideimage").stop().fadeTo("slow", 0.3);	// Fade the rest of the kwich panels
	},function(){
		jQuery('.slidecaption').stop().fadeTo("slow", 0);	// Hide fullcaption on mouse out
		jQuery(".slide-minicaption").stop().fadeTo("slow", 0.8);	// Show minicaption
		jQuery(".slideimage").stop().fadeTo("slow", 1);	// Show all kwicks wihout transparency again
	});
	
	jQuery('#kwickblock2').hover(function() {
		jQuery(".slide-minicaption").stop().fadeTo("slow", 0);
		jQuery('#kwickblock2 .slidecaption').stop().fadeTo("slow", 0.8);
		jQuery("#kwickblock2 .slideimage").stop().fadeTo("slow", 1);
		jQuery("#kwickblock1 .slideimage,#kwickblock3 .slideimage,#kwickblock4 .slideimage").stop().fadeTo("slow", 0.3);
	},function(){
		jQuery('.slidecaption').stop().fadeTo("slow", 0);
		jQuery(".slide-minicaption").stop().fadeTo("slow", 0.8);
		jQuery(".slideimage").stop().fadeTo("slow", 1);	
	});
	
	jQuery('#kwickblock3').hover(function() {
		jQuery(".slide-minicaption").stop().fadeTo("slow", 0);
		jQuery('#kwickblock3 .slidecaption').stop().fadeTo("slow", 0.8);
		jQuery("#kwickblock3 .slideimage").stop().fadeTo("slow", 1);
		jQuery("#kwickblock1 .slideimage,#kwickblock2 .slideimage,#kwickblock4 .slideimage").stop().fadeTo("slow", 0.3);
	},function(){
		jQuery('.slidecaption').stop().fadeTo("slow", 0);
		jQuery(".slide-minicaption").stop().fadeTo("slow", 0.8);
		jQuery(".slideimage").stop().fadeTo("slow", 1);	
	});
	
	jQuery('#kwickblock4').hover(function() {
		jQuery(".slide-minicaption").stop().fadeTo("slow", 0);
		jQuery('#kwickblock4 .slidecaption').stop().fadeTo("slow", 0.8);
		jQuery("#kwickblock4 .slideimage").stop().fadeTo("slow", 1);
		jQuery("#kwickblock1 .slideimage,#kwickblock2 .slideimage,#kwickblock3 .slideimage").stop().fadeTo("slow", 0.3);
	},function(){
		jQuery('.slidecaption').stop().fadeTo("slow", 0);
		jQuery(".slide-minicaption").stop().fadeTo("slow", 0.8);
		jQuery(".slideimage").stop().fadeTo("slow", 1);
	});
	
});